<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: product_listings.php 422 2014-01-19 11:35:06Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 422 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2014-01-19 11:35:06 +0000 (Sun, 19 Jan 2014) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

require ('includes/application_top.php');

require_once(DIR_WS_INCLUDES.'/xajax/xajax_core/xajax.inc.php');
$xajax = new xajax();
require(DIR_FS_ADMIN.DIR_WS_INCLUDES.'xajax/xajax.products_listings.php');
$xajax->processRequest();
require(DIR_WS_INCLUDES.'metatag.php');
$xajax->printJavascript();
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/growl/jquery.gritter.css" />
<script type="text/javascript" src="includes/javascript/growl/jquery.gritter.min.js"></script>
</head>
<body>
<?php require(DIR_WS_INCLUDES.'header.php'); ?>
<div id="wrapper">
	<table class="outerTable">
		<tr>
			<td class="columnLeft2" width="<?php echo BOX_WIDTH; ?>" valign="top">
				<?php require(DIR_WS_INCLUDES.'column_left.php'); ?>
			</td>
		    <td class="boxCenter" valign="top">
				<table class="table_pageHeading" border="0" width="100%" cellspacing="0" cellpadding="0">
		   			<tr>
		     			<td class="pageHeading">Produkt Listen <?php echo get_help('10','Produkt Listen'); ?></td>
					</tr>
				</table>
		    	<table width="100%" cellpadding="6">
		    		<tr>
		    			<td valign="top" width="1" id="dropdown" align="center">
		    				<?php
								$options = $db->db_query("SELECT
																list_name,
																list_id
															FROM
																".TABLE_PRODUCTS_LISTINGS."
															WHERE 
																p_id = '0'
															ORDER BY
																list_name 
															");
								echo '<select name="list_name" id="list_name" onchange="xajax_getListData(this.value)">';
								echo '	<option value="">wählen Sie eine Liste</option>';
								while(!$options->EOF) {
//echo_e($options->fields);
									if($options->fields['list_id'] > 0) {
										$get_childs = $db->db_query("SELECT list_name FROM ".TABLE_PRODUCTS_LISTINGS." WHERE p_id = '".$options->fields['list_id']."' ");
//echo_e($get_childs->fields);
										if($get_childs->_numOfRows) {
											echo '<optgroup label="'.trim(constant(strtoupper($options->fields['list_name']).'_TITLE')).'">';
											while(!$get_childs->EOF) {
												echo '	<option value="'.$get_childs->fields['list_name'].'">
															'.trim(constant(strtoupper($get_childs->fields['list_name']).'_TITLE')).'
														</option>';
												$get_childs->MoveNext();
											}
											echo '</optgroup>';
										}
									} else {
										echo '	<option value="'.$options->fields['list_name'].'">
													'.trim(constant(strtoupper($options->fields['list_name']).'_TITLE')).'
												</option>';
									}
									$options->MoveNext();
								}
								echo '</select>';
							?>
							<button onclick="xajax_saveValues(xajax.getFormValues('listing_options_form'))" id="save_button" style="margin-top:20px;display:none" class="button">
								<span class="button_disk-black"><?php echo BUTTON_SAVE ?></span>
							</button>
		    			</td>
		    			<td id="lists_data"></td>
		    		</tr>
		    	</table>
		     </td>
		</tr>
	</table>
</div>
<?php require(DIR_WS_INCLUDES.'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES.'application_bottom.php'); ?>